# Dockerfile.alpine
FROM alpine:latest

RUN echo 'http://mirrors.ustc.edu.cn/alpine/latest-stable/main' > /etc/apk/repositories
RUN echo 'http://mirrors.ustc.edu.cn/alpine/latest-stable/community' >> /etc/apk/repositories
RUN apk add -U redis && \
    rm -rf /var/cache/apk/*

RUN sed -i -e "s/s*bind 127.0.0.1/bind 0.0.0.0/g" /etc/redis.conf
RUN sed -i -e "s/s*daemonize yes/daemonize no/g" /etc/redis.conf
RUN sed -i -e "s/s*protected-mode yes/protected-mode no/g" /etc/redis.conf

EXPOSE 6379

VOLUME /data
WORKDIR /data

CMD ["redis-server", "/etc/redis.conf"]
